#ifndef DRINK_H
#define DRINK_H

#include <string>

using namespace std;

struct Drink // 饮料类
{
    // 饮料类成员变量
    string name;  // 饮料名称
    int quantity; // 饮料数量
    double price; // 饮料价格

public:
    Drink(string _name, int _quantity, double _price) : name(_name), quantity(_quantity), price(_price) {}
    Drink(const Drink &drink) : name(drink.name), quantity(drink.quantity), price(drink.price) {}
    ~Drink() {}
    bool is_empty() { return quantity == 0; }                                                                      // 判断饮料是否为空
    
    detail();

    operator-(int num) { quantity -= num; }                                                                        // 减少饮料数量
    operator+(int num) { quantity += num; }                                                                        // 增加饮料数量
    operator=(int num) { quantity = num; }                                                                         // 赋值
    operator=(double _price) { price = _price; }                                                                   // 赋值价格
    
    operator==(Drink & drink) { return name == drink.name && quantity == drink.quantity && price == drink.price; } // 判断两个饮料是否相同
}
#endif